1. Field of the Invention
The present invention relates to a compressed data expanding apparatus adopted in printers and the like, the apparatus expanding image data compressed by predetermined compression rules so as to reconstruct the original image data.
2. Description of the Related Art
Generally, image data (raster data) comprising x bits in the X direction (row direction) and y bits in the Y direction (column direction) in fact have a quantity exceeding the x.times.y bits. Since image data tend to be huge quantitatively, it is customary to reduce the data amount through compression based on internationally established compression rules so that memories may be used and data transfers carried out more efficiently. Given such compressed data as their input, printers expand (i.e., decompress) the data to reconstruct the original image data before printing. There are various compression rules. A typical compression rule involves consecutively converting image data to the corresponding compression codes on the basis of a compression code table made up of a plurality of compression codes and the bit string data corresponding to these code. At the end of each of the lines constituting the compressed data is an end code indicating the end of the line. Conversely to expand the compressed data involves comparing the data with the compression code table for successive conversion to bit string data.
In general, compressed data does not include size information indicating the original image data size (i.e., X- and Y-direction bit counts). Instead, the size information is usually established as part of additional data furnished independently of the compressed data. The compressed data is expanded by referring to the size information included in the additional date. Because the presence of the additional data is not always guaranteed, there may be cases in which the size of the compressed data to be processed (i.e., printed) is not known in advance.
Despite such unpredictability of the additional data, printing is effected typically by use of the following conventional compressed data expanding apparatus: the apparatus has an external memory in which to store compressed data to be expanded, a microprocessor unit (MPU), and an internal memory that may be accessed by the microprocessor unit. The internal memory accommodates a compression code table in advance. In operation, the microprocessor unit reads the first line of the compressed data, compares the data with the compression code table, converts the compression codes of the data into the corresponding bit string data, and adds up consecutively the number of bits in the bit string data up to the above-mentioned end code so as to find the number of bits in the X direction. The X-direction bit count is used as the basis for expanding all compressed data.
The conventional setup above requires allocating the compression code table, which is referenced only to find the X-direction bit count, in the precious internal memory accessible by the microprocessor unit. The table allocation requirement unit having to utilize a large-capacity internal memory which is generally expensive. This is an obstacle to reducing costs. Another disadvantage is that it takes a long time to compare each of the compression codes in the compressed data with the compression code table, which hampers the effort to improve the speed of processing.